package com.tjf.lib_network;

import com.tjf.lib_network.httpHelper.CallBackUtil;
import com.tjf.lib_network.httpHelper.IHttpProcessor;
import com.tjf.lib_network.okhttp.TokenCallBack;

import java.io.File;
import java.util.List;
import java.util.Map;

public class HttpHelper implements IHttpProcessor {
    private static HttpHelper httpHelper = new HttpHelper();

    private HttpHelper() {
    }

    // 被代理的对象
    private static IHttpProcessor httpProcessor = null;

    public static void init(IHttpProcessor processor) {
        httpProcessor = processor;
    }

    public static HttpHelper getHttpHelper() {
        return httpHelper;
    }

    @Override
    public void getTokenStatus(TokenCallBack callBack) {
        httpProcessor.getTokenStatus(callBack);
    }

    @Override
    public void okHttpGet(String url, CallBackUtil callBack) {
        httpProcessor.okHttpGet(url, callBack);
    }

    @Override
    public void okHttpGet(String url, Map<String, String> paramsMap, CallBackUtil callBack) {
        httpProcessor.okHttpGet(url, paramsMap, callBack);
    }

    @Override
    public void okHttpGet(String url, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpGet(url, paramsMap, headerMap, callBack);
    }

    @Override
    public void okHttpPost(String url, CallBackUtil callBack) {
        httpProcessor.okHttpPost(url, callBack);
    }

    @Override
    public void okHttpPost(String url, Map<String, String> paramsMap, CallBackUtil callBack) {
        httpProcessor.okHttpPost(url, paramsMap, callBack);
    }

    @Override
    public void okHttpPost(String url, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpPost(url, paramsMap, headerMap, callBack);
    }

    @Override
    public void okHttpPut(String url, CallBackUtil callBack) {
        httpProcessor.okHttpPut(url, callBack);
    }

    @Override
    public void okHttpPut(String url, Map<String, String> paramsMap, CallBackUtil callBack) {
        httpProcessor.okHttpPut(url, paramsMap, callBack);
    }

    @Override
    public void okHttpPut(String url, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpPut(url, paramsMap, headerMap, callBack);
    }

    @Override
    public void okHttpDelete(String url, CallBackUtil callBack) {
        httpProcessor.okHttpDelete(url, callBack);
    }

    @Override
    public void okHttpDelete(String url, Map<String, String> paramsMap, CallBackUtil callBack) {
        httpProcessor.okHttpDelete(url, paramsMap, callBack);
    }

    @Override
    public void okHttpDelete(String url, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {

    }

    @Override
    public void okHttpPostJson(String url, String jsonStr, CallBackUtil callBack) {
        httpProcessor.okHttpPostJson(url, jsonStr, callBack);
    }

    @Override
    public void okHttpPostJson(String url, String jsonStr, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpPostJson(url, jsonStr, headerMap, callBack);
    }

    @Override
    public void okHttpUploadFile(String url, File file, String fileKey, String fileType, CallBackUtil callBack) {
        httpProcessor.okHttpUploadFile(url, file, fileKey, fileType, callBack);
    }

    @Override
    public void okHttpUploadFile(String url, File file, String fileKey, String fileType, Map<String, String> paramsMap, CallBackUtil callBack) {
        httpProcessor.okHttpUploadFile(url, file, fileKey, fileType, paramsMap, callBack);
    }

    @Override
    public void okHttpUploadFile(String url, File file, String fileKey, String fileType, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpUploadFile(url, file, fileKey, fileType, paramsMap, headerMap, callBack);

    }

    @Override
    public void okHttpUploadListFile(String url, List<File> fileList, String fileKey, String fileType, CallBackUtil callBack) {
        httpProcessor.okHttpUploadListFile(url, fileList, fileKey, fileType, callBack);
    }

    @Override
    public void okHttpUploadListFile(String url, Map<String, String> paramsMap, List<File> fileList, String fileKey, String fileType, CallBackUtil callBack) {
        httpProcessor.okHttpUploadListFile(url, paramsMap, fileList, fileKey, fileType, callBack);

    }

    @Override
    public void okHttpUploadListFile(String url, Map<String, String> paramsMap, List<File> fileList,
                                     String fileKey, String fileType, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpUploadListFile(url, paramsMap, fileList, fileKey, fileType, headerMap, callBack);

    }

    @Override
    public void okHttpUploadMapFile(String url, Map<String, File> fileMap, String fileType, CallBackUtil callBack) {
        httpProcessor.okHttpUploadMapFile(url, fileMap, fileType, callBack);
    }

    @Override
    public void okHttpUploadMapFile(String url, Map<String, File> fileMap, String fileType, Map<String, String> paramsMap, CallBackUtil callBack) {
        httpProcessor.okHttpUploadMapFile(url, fileMap, fileType, paramsMap, callBack);
    }

    @Override
    public void okHttpUploadMapFile(String url, Map<String, File> fileMap, String fileType, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {
        httpProcessor.okHttpUploadMapFile(url, fileMap, fileType, paramsMap, headerMap, callBack);
    }

    @Override
    public void okHttpDownloadFile(String url, CallBackUtil.CallBackFile callBack) {
        httpProcessor.okHttpDownloadFile(url, callBack);
    }

    @Override
    public void okHttpDownloadFile(String url, Map<String, String> paramsMap, CallBackUtil.CallBackFile callBack) {
        httpProcessor.okHttpDownloadFile(url, paramsMap, callBack);
    }


}
